package com.itheima.example;

public class Example17 {
    public static void main(String[] args) {
        String s="ababcAbc,dedcba";
        System.out.println("e第一次出现在:"+s.indexOf("e"));
        System.out.println("bc第一次出现在:"+s.indexOf("bc"));
        System.out.println("第8个位置上是:"+s.charAt(8));
        System.out.println("字符串是否以a结尾:"+s.endsWith("a"));
        System.out.println("字符串是否以z结尾:"+s.endsWith("z"));
        System.out.println("字符串长度为:"+s.length());
        System.out.println("字符串长度为0？:"+s.isEmpty());
        System.out.println("字符串是否以a开始:"+s.startsWith("a"));
        System.out.println("字符串是否以z开始:"+s.startsWith("z"));
        System.out.println("字符串是否包含了ded:"+s.contains("ded"));
        System.out.println("转换为小写:"+s.toLowerCase());
        System.out.println("转换为大写:"+s.toUpperCase());
        System.out.println("将a全部替换为z:"+s.replace("a", "z"));
        System.out.println("从第6个字符到结束:"+s.substring(6));
        System.out.println("从第5个字符到第10个字符:"+s.substring(5,10));
        System.out.println("返回一个去除空格的字符串:"+s.trim());
    }
}
